package inc.sneid.reminderSpring.utils;

import java.sql.Timestamp;
import java.util.List;
import java.util.stream.Collectors;

public class TimestampUtils {

    public static Timestamp plusDays(Timestamp time, int days){
        return new Timestamp(time.getTime() + days * 24L * 60 * 60 * 1000);
    }

    public static Timestamp plusMinutes(Timestamp time, int minutes){
        return new Timestamp(time.getTime() + minutes * 60L * 1000);
    }

    public static Timestamp plusHours(Timestamp time, int hours){
        return new Timestamp(time.getTime() + hours * 60L * 60 * 1000);
    }

    public static List<Long> fromDays(List<Integer> days){
        return days.stream().map((x) -> x*24*60*60*1000L).collect(Collectors.toList());
    }

}
